"Bazel dependencies"

module(
    name = "rules_rs",
    version = "0.0.13",
)

bazel_dep(name = "rules_rust", version = "0.66.0")

# TODO(zbarsky): A bit unfortunate that we need to define a new set of host tools instead of reusing the existing one pulled in by rules_rust.
# Can we figure out how to access that? Perhaps add an alias?
rust_host_tools = use_extension("@rules_rust//rust:extensions.bzl", "rust_host_tools")
rust_host_tools.host_tools(
    name = "rs_rust_host_tools",
)
use_repo(
    rust_host_tools,
    "rs_rust_host_tools",
)

http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

[
    http_file(
        name = "toml2json_" + name,
        executable = True,
        sha256 = sha256,
        url = "https://github.com/dzbarsky/toml2json/releases/download/v0.0.7/toml2json_" + name + ext,
    )
    for name, sha256, ext in [
        ("darwin_amd64", "e2240483b28d95c7ae9ded7fb0e921142a644d6847c1da9b44ae3557117ed54f", ""),
        ("darwin_arm64", "20dd55c9d926a00b51c643a3c5677678eb5ddb8984ae2ad9cf3f701ccbb06d92", ""),
        ("linux_amd64", "f074ff54589ca601a491d3f8e33b9618d861d19d8e2359a0addf02d378f36c7c", ""),
        ("linux_arm64", "3f35040836858b5c1703be421ea1c06f83c68b6c14da37d0ee0655db891f125f", ""),
        ("windows_amd64", "7e5561170e088c717f87ba4c05ec6d3a0406b62133959530c2f4646158c27a97", ".exe"),
        ("windows_arm64", "bc6fbf776798a7beb7cb2b3feb898fcbc829b4106f0505cd08f251e7c1b2518e", ".exe"),
    ]
]

bazel_dep(name = "bazel_lib", version = "3.0.0")
bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "package_metadata", version = "0.0.5")
bazel_dep(name = "platforms", version = "0.0.5")
bazel_dep(name = "rules_cc", version = "0.2.8")

bazel_dep(name = "rules_go", version = "0.58.2", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.45.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.8.2", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "6.1.2", dev_dependency = True)
